﻿using System.Xml.Linq;

namespace Sgr.DataCategories.Services
{
    /// <summary>
    /// 行政区划查询接口
    /// </summary>
    public interface IAdmDivManagement
    {
        /// <summary>
        /// 异步获取所有的行政区划列表
        /// </summary>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        Task<IEnumerable<AdmDiv>> GetAllAsync(CancellationToken cancellationToken = default);

        /// <summary>
        /// 异步获取行政区划列表
        /// </summary>
        /// <param name="admDivKey">行政区划关键字（可选，默认为空字符串）</param>
        /// <param name="includeSubNodes">是否包含子孙节点</param>
        /// <param name="cancellationToken">取消操作的标记（可选）</param>
        /// <returns>行政区划集合</returns>
        Task<IEnumerable<AdmDiv>> GetListAsync(
            string admDivKey = "",
            bool includeSubNodes = false,
            CancellationToken cancellationToken = default);

        /// <summary>
        /// 异步刷新所有行政区划缓存
        /// </summary>
        /// <param name="cancellationToken">取消令牌</param>
        Task RefreshAsync(CancellationToken cancellationToken = default);
    }
}